package com.qj.travel.service.impl;

import com.qj.travel.db.dao.UserDao;
import com.qj.travel.db.model.UserModel;
import com.qj.travel.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Admin on 2016/10/11.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    public List<UserModel> getUserList() {
        return userDao.getUserList();
    }

    public UserModel getUser(int userId) {
        return userDao.getUser(userId);
    }

    public int insertUser(UserModel userModel) {
        return userDao.insertUser(userModel);
    }

    public int updateUser(UserModel userModel) {
        return userDao.updateUser(userModel);
    }

    public int deleteUser(int userId) {
        return userDao.deleteUser(userId);
    }

    public int updateGroup(int userId, String groupName) {
        return userDao.updateGroup(userId,groupName);
    }

    public List<UserModel> getUserByGroup(String groupName) {
        return userDao.getUserByGroup(groupName);
    }
}
